﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections;
using System.Collections.Generic;
using System.Windows.Markup;

namespace BlueRoseGames.Controls.Text
{
    [ContentProperty("Children")]
    public class TransformGroup : Transform
    {
        TransformCollection children = new TransformCollection();
        public override Point TransformPoint(Point p)
        {
            Point ret = p;
            foreach (Transform t in children)
            {
                if (!t.Disabled)
                    ret = t.TransformPoint(ret);
            }
            return ret;
        }

        public TransformCollection Children
        {
            get
            {
                return children;
            }
        }

        public override bool Changed
        {
            get
            {
                foreach (Transform t in children)
                {
                    if (t.Changed)
                    {
                        return true;
                    }
                }
                return false;
            }
            set
            {
                foreach (Transform t in children)
                {
                    t.Changed = false;
                }
            }
        }

    }
}
